<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            .active {
                color: red;
            }
        </style>
    </head>

    <body>
        <div id="app">
            <ul>
                <li v-for="(item, index) in list" :key="item.id" @click="activeIndex = index">
                    <a :class="{active: activeIndex === index}" href="#"> {{ item.name }}</a>
                </li> 
            </ul>
        </div>

        <script src="../src/Vue2/vue.js"></script>

        <script>
            const app = new Vue({
                el: '#app',
                data: {
                    activeIndex: 1,
                    list: [
                        {id: 1, name: '京东秒杀'},
                        {id: 2, name: '每日特价'},
                        {id: 3, name: '品类秒杀'}
                    ]
                }
            })
        </script>
    </body>
</html>